package com.ymtms.supplycar.dao;

import com.ymtms.supplycar.pojo.GoodsbillMaster;
import com.ymtms.supplycar.vo.GridRequest;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GoodsbillMasterMapper {
        int deleteByPrimaryKey(Integer gmid);

        int insert(GoodsbillMaster record);

        int insertSelective(GoodsbillMaster record);

        GoodsbillMaster selectByPrimaryKey(Integer gmid);

        int updateByPrimaryKeySelective(GoodsbillMaster record);

        int updateByPrimaryKey(GoodsbillMaster record);


        List<GoodsbillMaster> getAllByState(String state, @Param("begin") Integer begin,@Param("end") Integer end);


        int selectTotalCount(String state);
        @Select("select * from goodsbill_master where if_audit = #{state} and flag=0 and gmid in (select goods_bill_pkid from goodsbill_event where event_name ='待发运单')")
        List<GoodsbillMaster> selectAllByState(String state);

        // 根据职员账号login_id查询该职员所负责的货运单
        List<GoodsbillMaster> selectGoodsbillMasterByLoginId(String login_id);
}